bitkeeper revision 1.1389.5.45 (428092ac-yDbfUH2hZkDdl0sU-Sv8Q)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 10 May 2005 10:53:32 +0000 (10:53 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 10 May 2005 10:53:32 +0000 (10:53 +0000)
Various cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/io_apic.c
xen/arch/x86/mtrr/main.c
xen/arch/x86/traps.c
xen/arch/x86/x86_32/asm-offsets.c
xen/arch/x86/x86_32/mm.c
xen/arch/x86/x86_64/mm.c
xen/include/asm-x86/fixmap.h

index 929117c95c57ac73df6d496bb5478814b60fd52c..3e7c89cf0e1745829cdaa30332fad99b8e4efc48 100644 (file)
@@ -1233,7 +1233,6 @@ static inline void UNEXPECTED_IO_APIC(void)
 
 void __init print_IO_APIC(void)
 {
-#ifndef NDEBUG
        int apic, i;
        union IO_APIC_reg_00 reg_00;
        union IO_APIC_reg_01 reg_01;
@@ -1377,7 +1376,7 @@ void __init print_IO_APIC(void)
        }
 
        printk(KERN_INFO ".................................... done.\n");
-#endif /* !NDEBUG */
+
        return;
 }
 
@@ -1830,26 +1829,6 @@ static struct hw_interrupt_type lapic_irq_type = {
        .end            = end_lapic_irq
 };
 
-#if 0
-static void setup_nmi (void)
-{
-       /*
-        * Dirty trick to enable the NMI watchdog ...
-        * We put the 8259A master into AEOI mode and
-        * unmask on all local APICs LVT0 as NMI.
-        *
-        * The idea to use the 8259A in AEOI mode ('8259A Virtual Wire')
-        * is from Maciej W. Rozycki - so we do not have to EOI from
-        * the NMI handler or the timer interrupt.
-        */ 
-       apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
-
-       on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1);
-
-       apic_printk(APIC_VERBOSE, " done.\n");
-}
-#endif
-
 /*
  * This looks a bit hackish but it's about the only one way of sending
  * a few INTA cycles to 8259As and any associated glue logic.  ICR does
@@ -1953,14 +1932,6 @@ static inline void check_timer(void)
                 */
                unmask_IO_APIC_irq(0);
                if (timer_irq_works()) {
-#if 0
-                       if (nmi_watchdog == NMI_IO_APIC) {
-                               disable_8259A_irq(0);
-                               setup_nmi();
-                               enable_8259A_irq(0);
-                               check_nmi_watchdog();
-                       }
-#endif
                        return;
                }
                clear_IO_APIC_pin(0, pin1);
@@ -1980,12 +1951,6 @@ static inline void check_timer(void)
                                replace_pin_at_irq(0, 0, pin1, 0, pin2);
                        else
                                add_pin_to_irq(0, 0, pin2);
-#if 0
-                       if (nmi_watchdog == NMI_IO_APIC) {
-                               setup_nmi();
-                               check_nmi_watchdog();
-                       }
-#endif
                        return;
                }
                /*
index 02b4b4600453756b079230b06ddfaf82133d51f2..b7c4713c6926b0cf62a7179c4f5b627a4b0d4afb 100644 (file)
@@ -34,6 +34,7 @@
 #include <xen/config.h>
 #include <xen/init.h>
 #include <xen/pci.h>
+#include <xen/slab.h>
 #include <xen/smp.h>
 #include <xen/spinlock.h>
 #include <asm/mtrr.h>
index bdb15968bb0ee72368f149d18ae9a9fc51716da5..52bd64ac9bdc2f20d5981ec2bc60c50e1e052203 100644 (file)
@@ -115,7 +115,8 @@ asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
     if ( trapnr == TRAP_page_fault )
     {
         __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (cr2) : );
-        printk("Faulting linear address might be %p\n", _p(cr2));
+        printk("Faulting linear address: %p\n", _p(cr2));
+        show_page_walk(cr2);
     }
 
     printk("************************************\n");
@@ -349,7 +350,7 @@ asmlinkage int do_page_fault(struct cpu_user_regs *regs)
     show_page_walk(addr);
     panic("CPU%d FATAL PAGE FAULT\n"
           "[error_code=%04x]\n"
-          "Faulting linear address might be %p\n",
+          "Faulting linear address: %p\n",
           smp_processor_id(), regs->error_code, addr);
     return 0;
 }
index b440b0501e4b039b5c706aef5d09ec1376e442ef..7015b2a861649df48b94b069733fb302aabc1278 100644 (file)
@@ -90,7 +90,7 @@ void __dummy__(void)
     OFFSET(MULTICALL_result, multicall_entry_t, args[5]);
     BLANK();
 
-    DEFINE(FIXMAP_apic_base, __fix_to_virt(FIX_APIC_BASE));
+    DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
     BLANK();
 
     DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t)));
index e88195a8e1fc28fc63b705f1dbf771d1ab801699..045d904c218f7ba07685febe59ac9c9450c07839 100644 (file)
@@ -83,7 +83,7 @@ void __set_fixmap(
 {
     if ( unlikely(idx >= __end_of_fixed_addresses) )
         BUG();
-    map_pages(idle_pg_table, __fix_to_virt(idx), p, PAGE_SIZE, flags);
+    map_pages(idle_pg_table, fix_to_virt(idx), p, PAGE_SIZE, flags);
 }
 
 
index 3becac202427373afe3ad0ae222085e8ddbcfdbe..a1db5acd05d8ccd5fbc0483b9c88c11313a3961a 100644 (file)
@@ -125,7 +125,7 @@ void __set_fixmap(
 {
     if ( unlikely(idx >= __end_of_fixed_addresses) )
         BUG();
-    map_pages(idle_pg_table, __fix_to_virt(idx), p, PAGE_SIZE, flags);
+    map_pages(idle_pg_table, fix_to_virt(idx), p, PAGE_SIZE, flags);
 }
 
 
index d2d8ef183e2e26710ff96e273bcdd693b4dbb908..c70b2a8b016053befcbd6593f01e4d213bf9878e 100644 (file)
@@ -56,28 +56,7 @@ extern void __set_fixmap(
 #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
 #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
 
-extern void __this_fixmap_does_not_exist(void);
-
-/*
- * 'index to address' translation. If anyone tries to use the idx
- * directly without translation, we catch the bug with a NULL-deference
- * kernel oops. Illegal ranges of incoming indices are caught too.
- */
-static always_inline unsigned long fix_to_virt(const unsigned int idx)
-{
-    /*
-     * This branch gets completely eliminated after inlining, except when 
-     * someone tries to use fixaddr indices in an illegal way (such as mixing 
-     * up address types or using out-of-range indices).
-     *
-     * If it doesn't get removed, the linker will complain loudly with a 
-     * reasonably clear error message.
-     */
-    if (idx >= __end_of_fixed_addresses)
-        __this_fixmap_does_not_exist();
-
-    return __fix_to_virt(idx);
-}
+#define fix_to_virt(x)   (__fix_to_virt(x))
 
 static inline unsigned long virt_to_fix(const unsigned long vaddr)
 {